/*
 * Copyright (c) 2003-2005
 * XDoclet Team
 * All rights reserved.
 */
package org.xdoclet.plugin.hibernate;

import org.generama.*;

/**
 * Abstract test case for all hibernate mapping testing. We create plugin here, and also
 * setup entity resolver for xmlunit parsers. We take entity resolver from hibernate,
 * so we can always be sure that we got correct DTD.
 *
 * @author Konstantin Pribluda ( ko5tik(at)codehaus(dot)org )
 * @author Anatol Pomozov
 */
public abstract class AbstractHibernateMappingTestCase extends AbstractHibernateTestCase {
    protected Plugin createPlugin(MetadataProvider metadataProvider, WriterMapper writerMapper) {
        HibernateMappingPlugin plugin = new HibernateMappingPlugin(new JellyTemplateEngine(),
                (QDoxCapableMetadataProvider) metadataProvider, writerMapper);
        String version = getApplicableVersion();

        if (version != null) {
            plugin.setVersion(version);
        }

        plugin.setForce(true);
        plugin.setValidate(false);
        return plugin;
    }
}